new Vue({
    el:'#app',
    data:{
        Case_law:{
            caseId:'',
            clientId:{
                clientId:''
            },
            oppositeId:{
                clientId:''
            },
            caseTypeid:{
                caseTypeid:''
            },
            thirdParty:'',
            objectOfAction:'',
            locusStandi:'',
            agencyMoney:'',
            blendMoney:'',
            courtId:{
                courtId:''
            },
            stateSessionDate:'',
            sessionDate:'',
            causeOfAction:'',
            causeDetails:'',
            mainLawyer:{
                empId:''
            },
            version:'',
            comment:'',
            submitId:{
                userId:''
            }
        },
        Audit:{
            auditid:'',
            auditUserid:{
                userId:''
            },
            comment:'',
            if_pass:''
        }
    },
    created(){
        this.init();
    },
    methods:{
        init(){
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            var processid = getUrlParam("processid");
            //根据流程id查询案件相关的内容。
            this.$http.post("http://localhost:8080/audit/queryCaseByProcessid"
                ,{"processid":processid},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")")
                this.Case_law = msg.data;
            });
            loading.close();
        },
        onSubmit(){  //结案审核
            //获取登录用户id
            var userid = $.cookie("redisId");
            //获取流程id
            this.Audit.auditid = getUrlParam("processid");
            this.Audit.auditUserid.userId = userid;
            var data = JSON.stringify(this.Audit);

            this.$http.post("http://localhost:8080/Audit_closeLaw/completeProcess",
                {"data":data},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")")
                alert(msg.data);
                //办理完成返回到显示页面去
                window.location.href="MyTasks.html";
            });
        }
    }
})